home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / -seriously_amiga- / shareware / programming / e / easyplugins / examples / iconbox_demo.e < prev    next >
Text File  |  1997-12-06  |  2KB  |  61 lines

  1.  
  2. /*
  3.  
  4.     iconbox_demo: part of EasyPLUGINs package
  5.  
  6. */
  7.  
  8. OPT PREPROCESS, OSVERSION=37
  9.  
  10. MODULE 'tools/easygui', 'easyplugins/iconbox',
  11.        'icon', 'utility', 'utility/tagitem'
  12.  
  13. DEF iconbox:PTR TO iconbox_plugin, disabled=FALSE, selected=FALSE
  14.  
  15. PROC main() HANDLE
  16.  
  17.     IF (iconbase:=OpenLibrary('icon.library', 37))=NIL THEN Raise("iclb")
  18.     IF (utilitybase:=OpenLibrary('utility.library', 37))=NIL THEN Raise("utlb")
  19.  
  20.     NEW iconbox.iconbox([PLA_IconBox_IconName, 'Sys:Disk',
  21.                          TAG_DONE])
  22.  
  23.     easyguiA('iconbox_plugin example',  [ROWS,
  24.                                             [BEVELR,
  25.                                                 [PLUGIN, NIL, iconbox]
  26.                                             ],
  27.                                             [COLS,
  28.                                                 [CHECK, {toggle_disabled}, '_Disabled?', disabled, FALSE, -1, "d"],
  29.                                                 [CHECK, {toggle_selected}, '_Selected?', selected, FALSE, -1, "s"]
  30.                                             ]
  31.                                         ])
  32.  
  33. EXCEPT DO
  34.  
  35.     END iconbox
  36.  
  37.     IF utilitybase THEN CloseLibrary(utilitybase)
  38.     IF iconbase THEN CloseLibrary(iconbase)
  39.  
  40. ENDPROC
  41.  
  42. PROC toggle_disabled()
  43.  
  44.     IF disabled=FALSE THEN disabled:=TRUE ELSE disabled:=FALSE
  45.  
  46.     iconbox.set(PLA_IconBox_Disabled, disabled)
  47.  
  48. ENDPROC
  49.  
  50. PROC toggle_selected()
  51.  
  52.     IF selected=FALSE THEN selected:=TRUE ELSE selected:=FALSE
  53.  
  54.     iconbox.set(PLA_IconBox_ShowSelected, selected)
  55.  
  56. ENDPROC
  57.  
  58.  
  59.  
  60.  
  61.